{% extends "blog/blog_base.html" %}
{% load blog_extras prefab_tags comment_utils %}
{% load markup i18n %}

{% comment %} 
    Copyright (c) 2006-2007, PreFab Software Inc.
    Copyright (c) 2006, Andrew Gwozdziewycz apgwoz@gmail.com
    Copyright (c) 2008, aaloy - apsl.net
    All rights reserved. 
{% endcomment %}

{% block "contentbody" %}
<div class="span-17 last">
    <br/>
    <h5>{% trans "Resultats de la cerca" %}</h5>
    <div class="box">
        {% if object_list %}
        <p>{{object_list|length}}&nbsp;{% trans "Articles que contenen" %} <strong><spam id="search_term">{{query}}</span></strong>
        {% trans "trobats en " %}: {{time|floatformat:4}} {% trans "segons" %} </p>
        {% else %}
        <p>{% trans "No hi ha articles amb el terme "%}{{query}}</p>
        {% endif %}
    </div>
</div>
{% if object_list %}
<br/>
{% for found_item in object_list %}
    {% with found_item.instance as p %}
    <h1 class="alt article"><a href="{{ p.get_absolute_url }}" title="{{ p.headline }}" >{{ p.headline }}</a></h1>
    <hr/>
    <h5 class="info_article">{% trans "Escrit per " %}<a href='{% BLOG_ROOT %}user/{{ p.user }}/'>{{ p.user|title }}</a>{% trans " a " %}<a href='{% BLOG_ROOT %}{{ p.pub_date|date:"Y/m/d" }}/'>{{ p.pub_date|date:"d" }}</a> de <a href='{% BLOG_ROOT %}{{ p.pub_date|date:"Y/m" }}/'>{{ p.pub_date|date:"F" }}</a> , <a href='{% BLOG_ROOT %}{{ p.pub_date|date:"Y" }}/'>{{ p.pub_date|date:"Y" }}</a> a les {{ p.pub_date|time }}    {% if user.is_authenticated %}&nbsp; <a href="/admin/blog/entry/{{p.id}}/">{% trans "Editar" %}</a>{% endif %}</h5>
    <hr/>
    {% autoescape off %}
    <div class ="article_body">
        {{ p.body}}
    </div>
    {% endautoescape %}
    {% endwith %}
{% endfor %}
{% else %}
<p>{% trans "No s'han trobat entrades amb els termes de la cerca" %}</p>
{% endif %}
{% endblock "contentbody" %}

{% block extra-javascript %}
<script type="text/javascript">
    $(function(){
        var term = $('#search_term').html();

        $('.main-content').highlight(term);

        $('#unselect').click(function(){
            $('.main-content').removeHighlight();
            $('#selector').hide();
        });
       }
    );
</script>
{% endblock extra-javascript%}
